<!-- 订单页面的商品 -->
<template>
	<view class="flex" @click="click">
		<u-image :src="type==='order'?item.images:item.image" width="72" height="72" radius="16rpx"></u-image>
		<view class="ml-2" style="display: flex;flex-direction: column; width: 100%;">
			<u-text :text="item.goods_name" size="14" bold lines="2"></u-text>
			<!-- <view class="font-24 text-light6">{{type==='cart'?goodsSpec:type==='order'?item.goods_attr:item.goodsSpec}}</view> -->
			<view class="flex align-center justify-between" style="">
				<commonPrice :price="type ==='order'?item.goods_price:item.price" :color="type==='order'?'#484848':''"></commonPrice>
				<view class="font-24 text-light6 flex align-center justify-end">x{{type==='order'?item.total_num:item.goods_num}}</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default{
		props:{
			item:Object,
			type:{
				type:String,
				default:'list'			
			}
		},
		computed:{
			goodsSpec(){
				if(this.type === 'cart'){
					let spec = []
					this.item.goods_spec.map(v=>{
						spec.push(v.spec_value)
					})
					return spec.join('      ')
				}
				
			}
		},
		methods:{
			click(){
				this.$emit('click')
			}
		}
	}
</script>

<style>
</style>